package com.example.smartlearning.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.smartlearning.entity.LessonEntity;
import com.example.smartlearning.entity.RemarkUserEntity;

import java.util.List;

public interface LessonDao extends BaseMapper<LessonEntity> {
    //查询所有课程并分页 start表示开始位置 limit表示查询数量
    List<LessonEntity> selectAll(int start, int limit);

    //查询表中有多少行字段-
    String Count();

    //课程点赞
    int addUpvote(int lessonId, int userId);//传入视频id和用户id

    //取消点赞
    int cancelUpvote(int lessonId, int userId);//传入视频id和用户id

    //根据课程id查询课程详情
    LessonEntity selectLessonDetail(int lessonId);

    //根据课程id从试图获取课程的评价
    List<RemarkUserEntity> selectRemarkByLesson(int lessonId);

    //对于课程下的评价点赞
    String agreeRemark(int lessonRemarkId);

    //用户发表评论
    int appearRemark(int lessonId, String lessonRemarkText, int lessonRemarkUserId);
}
